package net.lainiao.morethread.Chapter2.demo2;

/**
 * Created by Administrator on 2017/2/28.
 */
public class Main {
    public static void main(String[] args) {
        Yingyuan yingyuan=new Yingyuan();
        ChangKou1 changKou1=new ChangKou1(yingyuan);
        Changkou2 changKou2=new Changkou2(yingyuan);
        Thread th1=new Thread(changKou1);
        Thread th2=new Thread(changKou2);
        th1.start();
        th2.start();
        try {
            th1.join();
            th2.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("Piaochang1 Tickts :"+yingyuan.getChang1());
        System.out.println("Piaochang2 Tickts :"+yingyuan.getChang2());
    }
}
